﻿//var mebtnopenurl = 'index.html;
//var timeLineLink = "share.html;
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
	window.shareData = {
		"imgUrl": "http://www.2014feiyu.com/tupian/feiyu.png",
		"timeLineLink": timeLineLink,
		"tTitle": "我离大奖只剩一步，等你来拆！",
		"tContent": "我给你发了个礼盒，赶紧帮我拆开！大奖抢不停！"
	};
	WeixinJSBridge.on('menu:share:appmessage', function(argv) {
		WeixinJSBridge.invoke('sendAppMessage', {
			"img_url": "http://www.2014feiyu.com/tupian/feiyu.png",
            "img_width": "160",
            "img_height": "160",
			"link": window.shareData.timeLineLink,
			"desc": window.shareData.tContent,
			"title": window.shareData.tTitle
		}, function(res) {
			document.location.href = mebtnopenurl;
		})
	});

	WeixinJSBridge.on('menu:share:timeline', function(argv) {
		WeixinJSBridge.invoke('shareTimeline', {
			"img_url": "http://www.2014feiyu.com/tupian/feiyu.png",
			"img_width": "160",
			"img_height": "160",
			"link": window.shareData.timeLineLink,
			"desc": window.shareData.tContent,
			"title": window.shareData.tTitle
		}, function(res) {
			document.location.href = mebtnopenurl;
		});
	});


	WeixinJSBridge.on('menu:share:weibo', function(argv) {
		WeixinJSBridge.invoke('shareWeibo', {
			"content": window.shareData.tContent,
			"url": window.shareData.timeLineLink
		}, function(res) {
			document.location.href = mebtnopenurl;
		});
	});

}, false)